﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Utity;
using System.IO;
using System.Diagnostics;

namespace TestInterface
{
    public partial class FrmOrmNext : Form
    {
        public FrmOrmNext()
        {
            InitializeComponent();
        }

        private void btnDynamicTableSelect_Click(object sender, EventArgs e)
        {
            //DataTable dtbl = new DataTable();
            //dtbl.Columns.Add("a");
            //dtbl.Columns.Add("b");
            //dtbl.Rows.Add(new object[] { "你好",2});
            JObject obj=   JObject.Parse("{a:1,b:{c:2}}");
            
            //JToken token=  JToken.FromObject(dtbl.Rows[0]);
            JObject o = JObject.Parse(ReadConfigContext());
            OrmParse parse = new OrmParse();
            parse.GetRoot = o;
            parse.GetNode = o["context"];
            parse.GetParamValues = new Dictionary<string, object>();
            parse.GetParamValues["AREA_ID"] = "";
            parse.GetParamValues["AREA_NAME"] = "";
           // Debug.WriteLine(parse.SqlDynamicTableSelect());
;        }

        string ReadConfigContext() {
            string fullPath=  Path.Combine(Application.StartupPath, "TestConfig.json");
            return File.ReadAllText(fullPath);
        }

    }
}
